#!/usr/bin/env python3
"""
更新数据库表结构
"""

import sys
import os
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))

from app import create_app, db

def update_database():
    """更新数据库表结构"""
    app = create_app()
    
    with app.app_context():
        try:
            print("正在更新数据库表结构...")
            db.create_all()
            print("数据库表结构更新成功")
            
        except Exception as e:
            print(f"更新失败: {str(e)}")
            raise

if __name__ == '__main__':
    update_database()

